<?php
include_once ("$basedir"."/Login/databaseconnection.php");

if(!loggedin())
{
	require_once ("$basedir"."/index.php");
}
   
   else
   {
$Competition_Id=$_POST['Competition_Id'];
 $Competition_Name=$_POST['Competition_Name'];
if($Competition_Id!=""&&$Competition_Name!="")
	{
$sql=mysql_query("INSERT INTO competitions(Competition_Id,Competition_Name)values('$Competition_Id','$Competition_Name')");
if(mysql_affected_rows()==1)
  {
$_SESSION['error']="This record is successfully registered!";
$_SESSION['OK']="OK";
$_SESSION['Competition_Id']=$Competition_Id;
  }

  if(mysql_affected_rows()==0)
  {
$_SESSION['error']="Sorry unable to register this record!";
  }
  }
  if($Competition_Id==""||$Competition_Name=="")
	{
	$_SESSION['errorin']="Please fill all!";
  }
   }
?>

